package com.cxh.rmsq.task;

import android.content.Context;

import androidx.lifecycle.LiveData;

import com.cxh.rmsq.db.model.BaseResultCommentListBean;
import com.cxh.rmsq.db.model.BaseResultListBean;
import com.cxh.rmsq.db.model.CommunityContent;
import com.cxh.rmsq.model.Result2;
import com.cxh.rmsq.net.proxy.RetrofitProxyServiceCreator;
import com.cxh.rmsq.net.service.SocialCircleService;
import com.cxh.rmsq.sp.UserCache;

import okhttp3.RequestBody;

public class SocialCircleTask {

    SocialCircleService socialCircleService;

    UserCache userCache;

    public SocialCircleTask(Context context) {
        socialCircleService =
                RetrofitProxyServiceCreator.getRetrofitService(context, SocialCircleService.class);

//        socialCircleService =
//                RetrofitProxyServiceCreator.getRetrofitService(context, SocialCircleService.class);
        userCache = new UserCache(context);
    }


    public LiveData<Result2<BaseResultListBean>> getToUserCommunityContentPage(String userId, String toUserId, int pageNo, int pageSize) {
        return socialCircleService.getToUserCommunityContentPage(userId, toUserId, pageNo, pageSize);
    }

    public LiveData<Result2<BaseResultListBean>> getCommunityPage(String userId, String toUserId, int pageNo, int pageSize) {
        return socialCircleService.getCommunityPage(userId, toUserId, pageNo, pageSize);
    }

    public LiveData<Result2<BaseResultListBean>> getSubscriberCommunityPage(String userId, String toUserId, int pageNo, int pageSize) {
        return socialCircleService.getSubscriberCommunityPage(userId, toUserId, pageNo, pageSize);
    }

    public LiveData<Result2<BaseResultListBean>> getCircleCommunityPage(String userId, String circleId, int pageNo, int pageSize) {
        return socialCircleService.getCircleCommunityPage(userId, circleId, pageNo, pageSize);
    }


    public LiveData<Result2<String>> commentLiked(RequestBody body) {
        return socialCircleService.commentLiked(body);
    }

    public LiveData<Result2<CommunityContent>> getCommunityInfo(String id, String viewerId) {
        return socialCircleService.getCommunityInfo(id, viewerId);
    }

    public LiveData<Result2<BaseResultCommentListBean>> getCommentList(String contentId, int pageNo, int pageSize) {
        return socialCircleService.getCommentList(contentId, pageNo, pageSize);
    }

    public LiveData<Result2<CommunityContent>> CreateComment(RequestBody body) {
        return socialCircleService.CreateComment(body);
    }

    public LiveData<Result2<String>> CreateCommunity(RequestBody body) {
        return socialCircleService.CreateCommunity(body);
    }

    public LiveData<Result2<String>> DelComment(String id) {
        return socialCircleService.DelComment(id);
    }
}
